package com.guangzhi.weijianzhi.adapter;

import java.util.List;

import com.guangzhi.weijianzhi.R;
import com.guangzhi.weijianzhi.company.center.CompileCompanyInfoActivity;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MyIndustryadapter extends BaseAdapter{

	private Context context;

	 private List<String>strings;
	 private int posi = 100;
	public MyIndustryadapter(List<String> lists,Context con){
		this.strings = lists;
		this.context = con;
	}

public void seletePosition(int po){
   
   this.posi = po;
   notifyDataSetChanged();
}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
			return strings.size();
		
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		
		
		TextView tv = new TextView(context);
			if(arg0==posi){
				tv.setTextColor(context.getResources().getColor(R.color.red));
			}else{
				tv.setTextColor(context.getResources().getColor(R.color.black));
			}
			tv.setText(strings.get(arg0));
			tv.setGravity(Gravity.CENTER);
			tv.setPadding(0, 15, 0, 15);
		
		return tv;
	}
	

}
